import java.util.Timer;

/**
 * @Author: Aerospace
 * @Date: 2023/11/21 9:06
 * @Description: Dream begins
 */
public class TimerTask {
    public static void main(String[] args) {
        Timer timer = new Timer();
        timer.schedule(new java.util.TimerTask() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName() + "执行一次");
            }
        }, 3000, 2000);

    }
}
